package com.example.demo12;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class dbdatabase {
    public Connection connection;
    public dbdatabase() throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.cj.jdbc.Driver");
        connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/mywebapp", "root", "123126");
    }
    public Connection getConnection(){
        return connection;
    }
}
